using System;
using System.Collections.Generic;
using System.Text;
using SSRSDeployer.ReportService2005;
using SSRSDeployer.Properties;

namespace SSRSDeployer
{
    public class FolderDeployer : ReportingServiceDeployer
    {
        public FolderDeployer(Dictionary<string, string> arguments) : base(arguments) { }

        protected override void ValidateArguments()
        {
            if (string.IsNullOrEmpty(Folder))
                throw new NullReferenceException(Resources.NoFolder);
        }

        public string Folder
        {
            get { return Arguments["/ifld:"]; }
        }

        public override void Deploy()
        {
            if (base.CheckIfExists(ItemTypeEnum.Folder, Parent, Folder))
                DeleteItem(Parent, Folder);
            _rs.CreateFolder(Folder, Parent, null);
            Console.WriteLine(Resources.FolderPublishSuccess, Folder);
        }

        
    }
}
